<?php
// +--------------------------------------------------
// | Name: 星空框架  会员身份模型
// +--------------------------------------------------
// | Version: V5.0
// +--------------------------------------------------
// | Author: xkyinzhe <zhonghuaxinxing@sina.cn>
// +--------------------------------------------------
// | Time: 2021-05-13 09:35
// +--------------------------------------------------
declare(strict_types=1);

namespace app\common\validate;

use think\Validate;

/**
 * @xk 会员身份模型
 */
class UserCard extends Validate
{
  protected $rule = [
    'user_card_id' => 'require|min:1',
    'user_card_name' => 'require',
    'rebate_ratio' => 'float|between:0,1'
  ];
  protected $message = [
    'user_card_id.require' => '请选择需要修改的会员身份',
    'user_card_name.require' => '请填写会员身份名称',
    'rebate_ratio.float' => '返佣比例的区间为0-1'
  ];
  protected $scene = [
    'create' => ['user_card_name','rebate_ratio'],
    'edit' => ['user_card_id','user_card_name','rebate_ratio']
  ];
}
